Skip to content

test(a2a): assert TaskResult content for rejected and auth-required states#270

Draft
bokelley wants to merge 1 commit intomainfrom
claude/issue-263-a2a-rejected-auth-required-tests
Draft

test(a2a): assert TaskResult content for rejected and auth-required states#270
bokelley wants to merge 1 commit intomainfrom
claude/issue-263-a2a-rejected-auth-required-tests

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Closes #263 (item 3 of 5 — test coverage gaps for A2A 1.0 states)

Summary

  • Adds test_rejected_task_result_content: asserts TaskResult shape for TASK_STATE_REJECTEDstatus=SUBMITTED, data=None, metadata["status"]="rejected", text message from TextPart.
  • Adds test_rejected_task_adcp_error_datapart_not_extracted: documents the known gap — a REJECTED task's adcp_error DataPart is silently dropped because _process_task_response only calls _extract_result_from_task for COMPLETED tasks. The test asserts current behavior (data=None) and comments the future fix path.
  • Adds test_auth_required_task_result_content: asserts TASK_STATE_AUTH_REQUIRED returns status=SUBMITTED, data=None, metadata["status"]="auth-required", TextPart message, plus task_id and context_id in metadata.

Prior tests for these two states (test_task_id_retained_on_auth_required_state, test_task_id_cleared_on_rejected_state) only asserted adapter.active_task_id; these tests close the TaskResult content gap called out in the issue.

Items NOT in this PR (flagged for @bokelley — see triage comment on #263)

  • Item 1 (wrapper policy — docs say MUST reject, Python unwraps silently): cross-repo normative conflict + potential behavior change → human decision needed
  • Item 2 (webhook envelope wrapping — bare vs StreamResponse-wrapped): requires A2A 1.0 §4.3.3 spec read before any code changes
  • Item 4 (integration test for 1.0 client → 0.3 server): no 0.3-only server fixture exists; significant infrastructure needed
  • Item 5 (CHANGELOG 4.1.0 subclasser breakage): CHANGELOG.md is bot-managed (release-please); add to MIGRATION_v3_to_v4.md but @bokelley should confirm scope

What was tested

  • pytest tests/test_protocols.py76 passed (3 new + 73 existing)
  • ruff check src/ — clean

Known nits (not fixed — surface for reviewer)

  • result.success is True for TASK_STATE_REJECTED in the else-branch of _process_task_response — semantically wrong but pre-dates this PR
  • The gap-documenting test could carry a pytest.mark.xfail marker once a fix is planned; left as a comment for now to keep this PR minimal

Pre-PR review

  • code-reviewer: approved — no blockers; nit on docstring wording and gap-documenting test completeness (both addressed)
  • dx-expert: approved — flagged typo in prompt diff (not in actual code; confirmed clean); nit on context_id assertion in auth test (added)

Session: https://claude.ai/code/session_01MxALGppjocjuZzDVp48tps


Generated by Claude Code

…tates

Closes #263 (item 3 — test coverage gaps for A2A 1.0 states).

Prior tests for TASK_STATE_REJECTED and TASK_STATE_AUTH_REQUIRED only
asserted adapter.active_task_id behavior.  These new tests also capture
the full TaskResult: status, data, message, and metadata["status"].

The gap-documenting test (adcp_error DataPart not extracted for
non-COMPLETED states) explicitly asserts data=None today and flags the
future fix path in a comment.

https://claude.ai/code/session_01MxALGppjocjuZzDVp48tps
@github-actions
Copy link
Copy Markdown
Contributor

IPR Policy Agreement Required

Thank you for your contribution! Before we can accept your pull request, you must agree to our Intellectual Property Rights Policy.

By making a Contribution, you agree that:

  • You grant the Foundation a perpetual, irrevocable, worldwide, non-exclusive, royalty-free copyright license to your Contribution
  • You grant a patent license under any Necessary Claims
  • You represent that you own or have sufficient rights to grant these licenses

To agree, please comment below with the exact phrase:

I have read the IPR Policy

You can read the full IPR Policy here.


I have read the IPR Policy


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A2A 1.0 follow-ups: wrapper policy, webhook envelope, test coverage

2 participants